package com.ruoyi.legal.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.legal.mapper.PracticeRecordsListViewMapper;
import com.ruoyi.legal.domain.PracticeRecordsListView;
import com.ruoyi.legal.service.IPracticeRecordsListViewService;

/**
 * recordsService业务层处理
 * 
 * @author xiaoxiao
 * @date 2025-07-01
 */
@Service
public class PracticeRecordsListViewServiceImpl implements IPracticeRecordsListViewService 
{
    @Autowired
    private PracticeRecordsListViewMapper practiceRecordsListViewMapper;

    /**
     * 查询records
     * 
     * @param categoryName records主键
     * @return records
     */
    @Override
    public PracticeRecordsListView selectPracticeRecordsListViewByCategoryName(String categoryName)
    {
        return practiceRecordsListViewMapper.selectPracticeRecordsListViewByCategoryName(categoryName);
    }

    /**
     * 查询records列表
     * 
     * @param practiceRecordsListView records
     * @return records
     */
    @Override
    public List<PracticeRecordsListView> selectPracticeRecordsListViewList(PracticeRecordsListView practiceRecordsListView)
    {
        return practiceRecordsListViewMapper.selectPracticeRecordsListViewList(practiceRecordsListView);
    }

    /**
     * 新增records
     * 
     * @param practiceRecordsListView records
     * @return 结果
     */
    @Override
    public int insertPracticeRecordsListView(PracticeRecordsListView practiceRecordsListView)
    {
        practiceRecordsListView.setCreateTime(DateUtils.getNowDate());
        return practiceRecordsListViewMapper.insertPracticeRecordsListView(practiceRecordsListView);
    }

    /**
     * 修改records
     * 
     * @param practiceRecordsListView records
     * @return 结果
     */
    @Override
    public int updatePracticeRecordsListView(PracticeRecordsListView practiceRecordsListView)
    {
        return practiceRecordsListViewMapper.updatePracticeRecordsListView(practiceRecordsListView);
    }

    /**
     * 批量删除records
     * 
     * @param categoryNames 需要删除的records主键
     * @return 结果
     */
    @Override
    public int deletePracticeRecordsListViewByCategoryNames(String[] categoryNames)
    {
        return practiceRecordsListViewMapper.deletePracticeRecordsListViewByCategoryNames(categoryNames);
    }

    /**
     * 删除records信息
     * 
     * @param categoryName records主键
     * @return 结果
     */
    @Override
    public int deletePracticeRecordsListViewByCategoryName(String categoryName)
    {
        return practiceRecordsListViewMapper.deletePracticeRecordsListViewByCategoryName(categoryName);
    }
}
